<!DOCTYPE html>
<html lang="en">
<head>
    <title>video</title>
    <script src="https://unpkg.com/flv.js/dist/flv.min.js"></script>
</head>
<body>
    <div>
        <video id="my-player" preload="auto" muted autoplay type="rtmp/flv">
   <source src="">
  </video>
    </div>
</body>
</html>
<script>
// 获取video节点
videoElement = document.getElementById('my-player');
if (flvjs.isSupported()) {
    flvPlayer = flvjs.createPlayer({
        type: 'flv',
        isLive: true,
        url: 'http://localhost:3000/output_file.flv',//flv格式流地址
    },{
        enableWorker: false, //不启用分离线程
        enableStashBuffer: false, //关闭IO隐藏缓冲区
        reuseRedirectedURL: true, //重用301/302重定向url，用于随后的请求，如查找、重新连接等。
        autoCleanupSourceBuffer: true //自动清除缓存
    });
    flvPlayer.attachMediaElement(videoElement);
    flvPlayer.load(); //加载
    flvPlayer.play();//播放
}
</script>
